/**
*  \file keytime.h
*
*  \brief Calculate time a signal was TRUE or FALSE.
*
*  \author Michael J. Hohmann  michael.hohmann@linde-mh.de
*
*
*
*
*
*/
#ifndef KEYTIME_H_INCLUDED
#define KEYTIME_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"

/*================================================[ public defines   ]================================================*/

/*================================================[ public datatypes ]================================================*/

/*================================================[ public variables ]================================================*/

/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/
/**
*  Keytime.
*
*  Calculate time an input was at the same condition.
*
*  \param state Current input state.
*  \param state_time State of the input.
*
*
*  \return Negative time if the input was FALSE.
*          Positive time if the input was TRUE.
*/
S16 keytime( BO state, S16 state_time );


S16 keytime_s16( S16 *p_time, BO state );


/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2018 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
